extends "../lingbo-1/lingbo-1.gd"

func _extInit():
	._extInit()
	attInfox.dod += 10
	attInfox.spd += 0.3
	lv = 2
	addSkill("<先手>每{cd}秒突进到护甲最低的敌人身边，获得3层<模糊>并赋予目标3层<暴露>", "所罗门鬼神", "slmgs", 6)

func _onBattleStart():
	._onBattleStart()
	yield(reTimer(0.45),"timeout")
	slmgs()

func _castCdSkill(id):
	._castCdSkill(id)
	if id=="slmgs":
		slmgs()

func slmgs():
	addBuff(buff.b_moHu.new(3))
	var chas = getAllChas(1)
	chas.sort_custom(sys, "sortByDef")
	var vs = [Vector2(0,0),Vector2(1,0),Vector2(-1,0),Vector2(0,1),Vector2(0,-1),Vector2(1,1),Vector2(-1,1),Vector2(-1,-1),Vector2(1,-1)]
	for cha in chas:
		if cha.isDeath || cha.isSumm:continue
		var mv = Vector2(cha.cell.x ,cha.cell.y)
		for i in config.aroundCells:
			var v = mv+i
			if matCha(v) == null && sys.main.isMatin(v) and setCell(v):
				var pos = sys.main.map.map_to_world(cell)
				ying(pos)
				position = pos
				aiCha = cha
				buff.addBaoLu(aiCha, 3)
				return